<?php

namespace app\yiluqianxing\home;

use think\Controller;
use think\Db;
use think\Request;


class Index extends Controller
{

    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        $this->assign('menu', 'yiluqianxing');
    }

    //抑路前行首页
    public function index()
    {
        $data=Db::table('dp_ylqx_zhoubao')
            ->order('id','desc')
            ->paginate(10,false,['fragment'=>'zb'])
            ->each(function($item, $key){
                $item['linkinf'] = Db::table('dp_admin_attachment')
                    ->where('id','=',$item['link'])
                    ->find();
                return $item;
            });
        $this->assign('data',$data);
        return $this->fetch();
    }
}